package com.bac.bacplatform;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;


public class PayPwdPhoneActivity extends BaseActivity implements OnClickListener{
	private Button mBtn_phone,mBtn_dial;
	private TextView hot_lineTextView;
	private String hot_lineString;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.paypwd_phone);
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub
		hot_lineTextView = (TextView) findViewById(R.id.hot_line_num);
		
		mBtn_phone = (Button) findViewById(R.id.paypwd_next_call);
		mBtn_phone.setOnClickListener(this);
		
		mBtn_dial = (Button) findViewById(R.id.dail_hot_line);
		mBtn_dial.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
		case R.id.paypwd_next_call:
			Intent intentToNextPayPwd = new Intent(PayPwdPhoneActivity.this,NextPayPwdActivity.class);
			startActivity(intentToNextPayPwd);
			break;
		case R.id.dail_hot_line:
			DailHotLine();
			break;
		default:
			break;
		}
	}
	
	/**
	 * 拨打客服电话
	 */
	private void DailHotLine(){
		hot_lineString = hot_lineTextView.getText().toString().trim();
		Intent intent = new Intent();
		intent.setAction(Intent.ACTION_CALL);
		intent.setData(Uri.parse("tel:"+hot_lineString));
		startActivity(intent);
	}

}
